<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="bolao" />
  <g:set var="entityName" value="${message(code: 'team.label', default: 'Team')}" />
  <title><g:message code="default.edit.label" args="[entityName]" /></title>
  </head>
  <body>
    <div class="body">
      <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
      </g:if>
      <g:hasErrors bean="${team}">
        <div class="errors">
          <g:renderErrors bean="${team}" as="list" />
        </div>
      </g:hasErrors>
      <g:form method="post"  enctype="multipart/form-data">
        <input type="hidden" name="id" value="${team?.id}" />
        <input type="hidden" name="version" value="${team?.version}" />
        <div class="dialog">
        <fieldset>
          <legend><g:message code="default.edit.label" args="[entityName]" /></legend>
          <table>
            <tbody>
              <tr class="prop">
                <td valign="top" class="name">
                  <label for="name"><g:message code="team.name.label" default="Name" />:</label>
                </td>
                <td valign="top" class="value ${hasErrors(bean:team,field:'name','errors')}">
                  <input type="text" maxlength="30" id="name" name="name" value="${fieldValue(bean:team,field:'name')}"/>
                </td>
              </tr>
              <tr class="prop">
                <td valign="top" class="name">
                  <label for="flagImage"><g:message code="team.flagImage.label" default="Flag Image" />:</label>
                </td>
                <td valign="top" class="value ${hasErrors(bean:team,field:'flagImage','errors')}">
                  <input type="file" id="flagImage" name="flagImage" />
                </td>
              </tr>
              <tr class="prop">
                <td valign="top" class="name">
                  <label for="group"><g:message code="team.group.label" default="Group" />:</label>
                </td>
                <td valign="top" class="value">
                  <g:select name="group.id" from="${mz.matafe.bolao.Group.list()}" optionKey="id"  optionValue="name" value="${team?.group?.id}" noSelection="['null': 'Seleccione']" />
                </td>
              </tr>
              <tr class="prop">
                <td valign="top" class="name">
                  <label for="teamDetails">Team Details:</label>
                </td>
                <td valign="top" class="value ${hasErrors(bean:team,field:'teamDetails','errors')}">
                </td>
              </tr>
            </tbody>
          </table>
        </fieldset>
        </div>
        <div class="buttons">
          <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
          <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
        </div>
      </g:form>
    </div>
  </body>
</html>
